package fuzzylizard.teamdocs.web;

import wicket.ISessionFactory;
import wicket.Session;
import wicket.protocol.http.WebApplication;
import fuzzylizard.teamdocs.web.wicket.TeamdocsSession;

/**
 * Application object for your web application. If you want to run this
 * application without deploying, run the Start class.
 * 
 * @see fuzzylizard.teamdocs.web.Start#main(String[])
 */
public class TeamdocsApplication extends WebApplication {

    /**
     * Constructor
     */
    public TeamdocsApplication() {
    }

    /**
     * @see wicket.Application#getHomePage()
     */
	@SuppressWarnings("unchecked")
    public Class getHomePage() {
        return Dashboard.class;
    }
    
    public void init() {
        super.init();
        mountBookmarkablePage("/login", Login.class);
        mountBookmarkablePage("/dashboard", Dashboard.class);
    }
    
    /**
     * @see wicket.protocol.http.WebApplication#getSessionFactory()
     */
    public ISessionFactory getSessionFactory() {
        return new ISessionFactory() {
            public Session newSession() {
                return new TeamdocsSession(TeamdocsApplication.this);
            }
        };
    }
}